<?php
$this->headScript()->appendFile(_STATIC_HTTP . '/admin/js/index.js');
?><!DOCTYPE html>
<html>
<head>
<meta name="robots" content="none" />
<title>Control Panel::<?php echo $this->language()->getSetting()->getTitle();?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7,9">
<meta http-equiv="Content-Language" content="en_US" >
<link rel="icon" href="<?php echo $this->baseUrl('/favicon.ico');?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->baseUrl('/favicon.ico');?>" type="image/x-icon" />
<link href="<?php echo $this->baseUrl(_STATIC_HTTP . '/admin/css/index.css');?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl(_STATIC_HTTP . '/admin/css/lang/' . $this->language()->getName() . '.css');?>" rel="stylesheet" type="text/css" >
<?php echo $this->headLink() . $this->headStyle() . "\r\n";?>
<base target="mainFrame" />
</head>

<body>
<div id="menu">
	<ul>
		<?php if($this->user) { ?>
		<li class="active">
			<a href="<?php echo $this->url('index/index');?>" target="_self"><?php echo $this->language('Dashboard');?></a>
			<ul>
				<li><a href="<?php echo $this->url('picture/spacial/list');?>"><?php echo $this->language('Specials');?></a></li>
			</ul>
		</li>
		<?php } ?>
	</ul>
</div>
<form action="<?php echo $this->url('index/selectLanguage');?>" method="post" target="_self">
<?php echo $this->form()->hidden('referer', $this->url('index/index')) . "\n";?>
<div id="header" class="header">
	<h1>Control Panel<sup>®</sup></h1>
	<div>
		<?php 
			echo '<h3>';
			echo '<label><select name="language" onchange="changeLanguage(this);" style="font-size:10px;">';
			$_lang = system_user_instance::getInstance()->getSession()->getLanguage();
			foreach(new system_setting_language() AS $lang) {
				echo '<option value="' . strtolower($lang->getKey()) . '"';
				if(strtolower($_lang) == strtolower($lang->getKey())) echo ' selected="selected"';
				echo '>» ' . $lang->getName();
				if($lang->getEnable() !== true) {
					echo '(*)';
				}
				echo '</option>';
			}
			echo '</select></label>&nbsp;';
			echo '<a href="' . $this->language()->getSetting()->getHttp() . '" target="_blank">Go»</a>';
			echo '</h3>';
			
			echo '<p>';
			if($this->user) {
				echo $this->language('Hi') . '! ';
				echo '<strong>' . system_user_instance::getInstance()->getSession()->getIdentity() . '</strong>, ';
				echo '<a href="' . $this->url('index/logout') . '" ';
				echo 'onclick="return confirm(\'' . $this->language('Are you sure to logout system?') . '\');" target="_self"';
				echo '>' . $this->language('Logout') . '!</a>';
			} else {
				echo 'Welcome to CMSDream,Inc!';
			}
			echo "</p>\r\n";
		?>
	</div>
</div>
</form>
<div id="maskDiv"></div>
<div id="body">
<?php echo $this->content;?>
</div>
<?php $this->headScript()->captureStart();?>
function changeLanguage(s) {
	var f = s.form;
	if($('#mainFrame').length == 0) {
		f.submit();
		return true;
	}
	var r = '<?php echo $this->url('index/index');?>';
	var b = document.getElementById('mainFrame').contentWindow.location;
	f.referer.value = r + '?callback=' + encodeURIComponent(b);
	return f.submit();
}
<?php $this->headScript()->captureEnd();?>
<?php echo $this->render('include/footer.phtml');?>
</body>
</html>